<?
$tmppath="../../";
REQUIRE ($tmppath."include/login.php");
REQUIRE ($tmppath.$templates."up.php");
REQUIRE($tmppath."protect/connect.php");



$query="SELECT alliance_id,alliance_name FROM sdalliance WHERE alliance_cacher!='o' ORDER BY alliance_name";
$resultat=mysql_query($query);







//Chercher les inventions
//***********************




ECHO "<BR>

<table width=\"95%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#000000\"><tr>
    <td>";
ECHO"<table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"1\" bordercolor=\"#000000\">
  <tr>
    <td><table width=\"100%\" border=\"0\" align=\"center\" cellspacing=\"0\" cellpadding=\"0\">
        <tr>
          <td width=\"50\" CLASS=TD3><div align=\"center\"><strong>Voir</strong></div></td>

          <td width=\"50%\" CLASS=TD3><div align=\"center\"><strong>Nom</strong></div></td>


          <td CLASS=TD3><div align=\"center\"><strong>Nom d'inscrit</strong></div></td>
        </tr>";

$var_tmp=0;
$nbr_cat=0;

WHILE ($tmp=mysql_fetch_array($resultat)){


//Compter les representant.
$query ="SELECT count(*) FROM sduser_perso WHERE perso_alliance=$tmp[0]";
$resultat2=mysql_query($query);
$row = mysql_fetch_array($resultat2);
$nbr_inscrit=$row[0];


IF ($row[0]==0){
     $query ="DELETE FROM sdalliance WHERE alliance_id=$tmp[0]";
     $resultat2=mysql_query($query);
}
ELSE{
    $nbr_cat++;
IF ($var_tmp==0){
$bgr="CLASS=TD1";
$var_tmp=1;

}
ELSE{
$bgr="";
$var_tmp=0;
$bgr="CLASS=TD2";

}

    //-----------------------------

     $lien2="window.open('../../include_l.php?p=vis_alliance&alliance=$tmp[0]&$SID', 'unite', 'scrollbars=yes,status=no,top=0,left=0,width=430,height=500,copyhistory=0')";


ECHO"<tr>
          <td $bgr><div align=\"center\"><a href=\"#\" onClick=\"$lien2\">Go!</a></div></td>

          <td $bgr><div align=\"center\">$tmp[1]</div></td>

          <td $bgr><div align=\"center\">$nbr_inscrit</div></td>

          </tr>";





}

}//Fin du else du IF IF ($row[0]==0){

echo "</tr>
    </td></table></tr>
    </td></table></tr>
    </td></table><br>";

//Affichage des caracteristique des alliances.
//********************************************



$query="SELECT count(*) FROM sdalliance";
$resultat=mysql_query($query);
$tmp=mysql_fetch_array($resultat);
$nbr_ville=$tmp[0];

echo"<table width=\"300\" border=\"1\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" bordercolor=\"#000000\">
  <tr>
    <td><div align=\"center\">Nombre d'alliance : $nbr_ville<br>" ;







echo"</tr></table>";

?>
<?
